function fn() {
    $.ajax({
        type: 'GET',
        url: '/admin/users',
        data: {
            pagenum: 1,
            pagesize:2,
        },
        success: function (res) {
            let name
            let src
            // console.log(res);
            res.data.forEach(item => {
                name = item.username
                src = item.user_pic
            });
            $('.username').html(name)
            $('.layui-nav-img').attr('src',src)
        } 
    })
}
fn()


$('#logout').on('click', function () {
    localStorage.removeItem('token');
    location.href = './login.html';
})
